Optimal. Leaf size=52 \[ -\frac{2 \sin ^3(c+d x)}{3 a^2 d}+\frac{\sin (c+d x)}{a^2 d}+\frac{2 i \cos ^3(c+d x)}{3 a^2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.113771, antiderivative size = 52, normalized size of antiderivative = 1., number of steps used = 9, number of rules used = 6, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.207, Rules used = {3092, 3090, 2633, 2565, 30, 2564} \[ -\frac{2 \sin ^3(c+d x)}{3 a^2 d}+\frac{\sin (c+d x)}{a^2 d}+\frac{2 i \cos ^3(c+d x)}{3 a^2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3092
Rule 3090
Rule 2633
Rule 2565
Rule 30
Rule 2564
Rubi steps
\begin{align*} \int \frac{\cos (c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx &=-\frac{\int \cos (c+d x) (i a \cos (c+d x)+a \sin (c+d x))^2 \, dx}{a^4}\\ &=-\frac{\int \left (-a^2 \cos ^3(c+d x)+2 i a^2 \cos ^2(c+d x) \sin (c+d x)+a^2 \cos (c+d x) \sin ^2(c+d x)\right ) \, dx}{a^4}\\ &=-\frac{(2 i) \int \cos ^2(c+d x) \sin (c+d x) \, dx}{a^2}+\frac{\int \cos ^3(c+d x) \, dx}{a^2}-\frac{\int \cos (c+d x) \sin ^2(c+d x) \, dx}{a^2}\\ &=\frac{(2 i) \operatorname{Subst}\left (\int x^2 \, dx,x,\cos (c+d x)\right )}{a^2 d}-\frac{\operatorname{Subst}\left (\int x^2 \, dx,x,\sin (c+d x)\right )}{a^2 d}-\frac{\operatorname{Subst}\left (\int \left (1-x^2\right ) \, dx,x,-\sin (c+d x)\right )}{a^2 d}\\ &=\frac{2 i \cos ^3(c+d x)}{3 a^2 d}+\frac{\sin (c+d x)}{a^2 d}-\frac{2 \sin ^3(c+d x)}{3 a^2 d}\\ \end{align*}
Mathematica [A] time = 0.0574055, size = 73, normalized size = 1.4 \[ \frac{\sin (c+d x)}{2 a^2 d}+\frac{\sin (3 (c+d x))}{6 a^2 d}+\frac{i \cos (c+d x)}{2 a^2 d}+\frac{i \cos (3 (c+d x))}{6 a^2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.112, size = 57, normalized size = 1.1 \begin{align*} 2\,{\frac{1}{d{a}^{2}} \left ( \left ( \tan \left ( 1/2\,dx+c/2 \right ) -i \right ) ^{-1}-2/3\, \left ( \tan \left ( 1/2\,dx+c/2 \right ) -i \right ) ^{-3}+{\frac{i}{ \left ( \tan \left ( 1/2\,dx+c/2 \right ) -i \right ) ^{2}}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.04839, size = 61, normalized size = 1.17 \begin{align*} \frac{i \, \cos \left (3 \, d x + 3 \, c\right ) + 3 i \, \cos \left (d x + c\right ) + \sin \left (3 \, d x + 3 \, c\right ) + 3 \, \sin \left (d x + c\right )}{6 \, a^{2} d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.464128, size = 86, normalized size = 1.65 \begin{align*} \frac{{\left (3 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i\right )} e^{\left (-3 i \, d x - 3 i \, c\right )}}{6 \, a^{2} d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.416579, size = 94, normalized size = 1.81 \begin{align*} \begin{cases} \frac{\left (6 i a^{2} d e^{3 i c} e^{- i d x} + 2 i a^{2} d e^{i c} e^{- 3 i d x}\right ) e^{- 4 i c}}{12 a^{4} d^{2}} & \text{for}\: 12 a^{4} d^{2} e^{4 i c} \neq 0 \\\frac{x \left (e^{2 i c} + 1\right ) e^{- 3 i c}}{2 a^{2}} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.11315, size = 63, normalized size = 1.21 \begin{align*} \frac{2 \,{\left (3 \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 3 i \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 2\right )}}{3 \, a^{2} d{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - i\right )}^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]